add_library(CybertronSensorBase STATIC "")

set(osi_src_path ${CYBERTRON_PATH_ROOT}/3rdparty/osi/osi3)

include_directories("${CYBERTRON_PATH_SOURCE}/CoreLibrary/include")
include_directories("${CYBERTRON_PATH_SOURCE}/Worker/BaseLibrary/SensorBase/include")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty")
include_directories(osi_src_path)

IF (WIN32)
	add_definitions(-D_WIN32_WINNT=0x0501)
ENDIF()
IF (UNIX)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()

add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)

file(GLOB_RECURSE srcs *.h *.hh *i *.hpp *.c *.cc *.cpp)
target_sources(CybertronSensorBase PRIVATE ${srcs})
source_group(TREE ${CMAKE_CURRENT_LIST_DIR} FILES ${srcs})

file(GLOB_RECURSE srcs ${osi_src_path}/*.pb.h ${osi_src_path}/*.pb.cc ${osi_src_path}/*.proto)
target_sources(CybertronSensorBase PRIVATE ${srcs})
source_group(src/osi3 FILES ${srcs})

SetDefaultTargetProperties(CybertronSensorBase)

target_link_libraries(CybertronSensorBase CybertronCore)
target_link_libraries(CybertronSensorBase protobuf)

IF (MSVC)
	SET_PROPERTY(TARGET CybertronSensorBase PROPERTY FOLDER "Worker")
ENDIF()
